import java.util.Scanner;

public class homework09 {

    public static void main(String[] args) {

                Scanner sc=new Scanner(System.in);
                int n=sc.nextInt();
                int m= sc.nextInt();
                int arr[] =new int[n+1];
                int i,j;
                for(i=0;i<=n;i++)
                {
                    arr[i]=i;
                }
                for(j=2;j<=m;j++)
                {    for(i=1;i<=n;i++)
                {if(i%j==0)
                    if(arr[i]!=0){arr[i]=i;}
                    else {arr[i]=i; }
                }
                }
                for (i=1;i<=n;i++)
                {
                    if(arr[i]!=0)System.out.println(i+" ");
                }

    }
}

